﻿using System;
using System.Threading.Tasks;

namespace WxLib.Core.RequestHandlers
{
    /// <summary>
    /// </summary>
    public interface IPostRequestHandler : IRequestHandler
    {
        /// <summary>
        /// 对指定的URI执行POST请求，并返回反序列化的数据。
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="uri"></param>
        /// <param name="postData"></param>
        /// <returns></returns>
        Task<T> PostRequestAsync<T>(Uri uri, string postData);

        Task<T> PostRequestAsync<T>(Uri uri, byte[] postData);

        /// <summary>
        /// 对指定的URI执行POST并带证书请求，并返回反序列化的数据。
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="uri"></param>
        /// <param name="postData"></param>
        /// <param name="certPath"></param>
        /// <param name="certPassword"></param>
        /// <returns></returns>
        Task<T> PostRequestAsync<T>(Uri uri, string postData, string certPath, string certPassword);

    }
}